package org.sqldroid;

import java.io.InputStream;
import java.io.OutputStream;
import java.sql.Blob;
import java.sql.SQLException;

public class SqldroidBlob implements Blob {

	byte[] b;

	public SqldroidBlob(final byte[] b) {
		this.b = b;
	}

	public InputStream getBinaryStream() throws SQLException {
		System.err.println(" ********************* not implemented @ " + DebugPrinter.getFileName() + " line " + DebugPrinter.getLineNumber());
		return null;
	}

	public byte[] getBytes(final long pos, final int length) throws SQLException {
		return b;
	}

	public long length() throws SQLException {

		return b.length;
	}

	public long position(final Blob pattern, final long start) throws SQLException {
		System.err.println(" ********************* not implemented @ " + DebugPrinter.getFileName() + " line " + DebugPrinter.getLineNumber());
		return 0;
	}

	public long position(final byte[] pattern, final long start) throws SQLException {
		System.err.println(" ********************* not implemented @ " + DebugPrinter.getFileName() + " line " + DebugPrinter.getLineNumber());
		return 0;
	}

	public OutputStream setBinaryStream(final long pos) throws SQLException {
		System.err.println(" ********************* not implemented @ " + DebugPrinter.getFileName() + " line " + DebugPrinter.getLineNumber());
		return null;
	}

	public int setBytes(final long pos, final byte[] theBytes) throws SQLException {
		System.err.println(" ********************* not implemented @ " + DebugPrinter.getFileName() + " line " + DebugPrinter.getLineNumber());
		return 0;
	}

	public int setBytes(final long pos, final byte[] theBytes, final int offset, final int len)
			throws SQLException {
		System.err.println(" ********************* not implemented @ " + DebugPrinter.getFileName() + " line " + DebugPrinter.getLineNumber());
		return 0;
	}

	public void truncate(final long len) throws SQLException {
		System.err.println(" ********************* not implemented @ " + DebugPrinter.getFileName() + " line " + DebugPrinter.getLineNumber());

	}

	public void free() throws SQLException {
		// TODO Auto-generated method stub

	}

	public InputStream getBinaryStream(final long pos, final long length)
			throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

}
